<?phpnamespace app\common\model;use think\Db;use think\Exception;use think\Model;class Thumb extends Model{    /**     * 获取点赞数量或者某人是否点赞     * @param $type 1文章 2问答 3分享 4留言     * @param $related_id 关联的id     * @param $is_operate_id 用户id是否点赞     * @return int|string|array     * @throws Exception     */    public static function number($type,$related_id,$is_operate_id =''){        $con = [];        if(!empty($type)){            $con['type'] = $type;        }        if(!empty($related_id)){            $con['related_id'] = $related_id;        }        if(empty($is_operate_id)){            return  self::where($con)->count();        }else{            $count = self::where($con)->count();            $con['operate_id'] = $is_operate_id;            $is_operate = self::where($con)->count();            return ['count'=>$count,'is_thumb'=>$is_operate];        }    }}